﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

using LowLevelGraphics;
using LowLevelGraphics.Filter;

namespace ImageRecognition2.Action
{
    /// <summary>
    /// Use this to "weigh" a picture
    /// </summary>
    public class ActionWeighting : AbstractCommand
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ActionWeighting"/> class.
        /// </summary>
        public ActionWeighting()
        {
        }

        /// <summary>
        /// Runs the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public override void Run(object sender, EventArgs e)
        {
            Bitmap bitmap = (Bitmap)MainFormSingleton.ActivePictureBox.BackgroundImage;
            UnsafeBitmap unsafeBitmap = new Weighting(1, 0).Execute(bitmap);
            unsafeBitmap.Dispose();
        }
    }
}
